<?php
error_reporting(E_ALL | E_STRICT | E_NOTICE);

// $mm = memcache_connect("localhost", 11211);
// $mm->add('php',"data://text/plain,".urlencode("<? echo 'hello';?".">"));
// 
// include($mm->get('php'));
function benchInclude() {
	include('tmp/test.php');
}

function benchEval() {
	eval(file_get_contents('tmp/test.code'));
}

$code = '$b=4;$a=$b+2*$b;$f = create_function("","return \\$GLOBALS[\\"a\\"];");';
//file_put_contents($phpStream,'<?'.$code.'?'.'>');
//file_put_contents($codeStream,$code);

$cnt = 1000;

$t = microtime(true);
for($i=0;$i<$cnt;++$i) {
	benchInclude();
}
echo microtime(true)-$t;
echo "\n";

$t = microtime(true);
for($i=0;$i<$cnt;++$i) {
	benchEval();
}
echo microtime(true)-$t;
echo "\n";
phpinfo();
?>